package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MerchantTypeMapper;
import com.ruoyi.system.domain.MerchantType;
import com.ruoyi.system.service.IMerchantTypeService;

/**
 * 商家和分类关联Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-04
 */
@Service
public class MerchantTypeServiceImpl implements IMerchantTypeService 
{
    @Autowired
    private MerchantTypeMapper merchantTypeMapper;

    /**
     * 查询商家和分类关联
     * 
     * @param merchantId 商家和分类关联主键
     * @return 商家和分类关联
     */
    @Override
    public MerchantType selectMerchantTypeByMerchantId(Long merchantId)
    {
        return merchantTypeMapper.selectMerchantTypeByMerchantId(merchantId);
    }

    /**
     * 查询商家和分类关联列表
     * 
     * @param merchantType 商家和分类关联
     * @return 商家和分类关联
     */
    @Override
    public List<MerchantType> selectMerchantTypeList(MerchantType merchantType)
    {
        return merchantTypeMapper.selectMerchantTypeList(merchantType);
    }

    /**
     * 新增商家和分类关联
     * 
     * @param merchantType 商家和分类关联
     * @return 结果
     */
    @Override
    public int insertMerchantType(MerchantType merchantType)
    {
        return merchantTypeMapper.insertMerchantType(merchantType);
    }

    /**
     * 修改商家和分类关联
     * 
     * @param merchantType 商家和分类关联
     * @return 结果
     */
    @Override
    public int updateMerchantType(MerchantType merchantType)
    {
        return merchantTypeMapper.updateMerchantType(merchantType);
    }

    /**
     * 批量删除商家和分类关联
     * 
     * @param merchantIds 需要删除的商家和分类关联主键
     * @return 结果
     */
    @Override
    public int deleteMerchantTypeByMerchantIds(Long[] merchantIds)
    {
        return merchantTypeMapper.deleteMerchantTypeByMerchantIds(merchantIds);
    }

    /**
     * 删除商家和分类关联信息
     * 
     * @param merchantId 商家和分类关联主键
     * @return 结果
     */
    @Override
    public int deleteMerchantTypeByMerchantId(Long merchantId)
    {
        return merchantTypeMapper.deleteMerchantTypeByMerchantId(merchantId);
    }
}
